#include<bits/stdc++.h>
using namespace std;
long long n;
vector<int> v;
int a[100000];
void output(vector<int> &vt)
{
    for(int i=0;i<vt.size();i++)
        cout<<vt[i]<<" ";
    cout<<endl;
}
int findmax(vector<int> &visited,int i)
{
    if(v[i]==v[n-1]) return -2;
    int x=v[i];int k=i+1;
    if(x==v[k])
    {
        k+=a[x]-1;
    }
    for(;k<n;k++)
    {
        if(v[k]>x&&visited[k]!=1)
            return k;
    }
    return -2;//when find -2 end
}
int main()
{
    freopen("duel.in","r",stdin);
   freopen("duel.out","w",stdout);
    cin>>n;
    v.resize(n);
   vector<int> visited(n,-1);
    for(int i=0;i<n;i++)
    {
         cin>>v[i];
         a[v[i]]++;
    }
    //cout<<a[136]<<endl;
    sort(v.begin(),v.end());
    int cnt=n;
    int maxx=v[n-1];
    //cout<<v[17]<<" "<<maxx<<endl;
    for(int i=0;i<n;i++)
    {
        if(v[i]==maxx) break;
        int k=findmax(visited,i);
        if(k==-2) break;
       //cout<<i<<" "<<k<<endl;
        visited[k]=1;
        //a[v[i]]--;
        cnt--;
    }
    //output(visited);
   cout<<cnt;

    return 0;
}
